From: Carlos Garnacho Date: Mon, 17 Sep 2018 19:04:48 +0000 (+0200) Subject: keyboard: Filter redundant FocusTracker::position-changed signals X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~929^2^2~27 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=7ea034c7190d2bd13a0b3ab863df0d6700a1732e;p=gnome-shell.git keyboard: Filter redundant FocusTracker::position-changed signals Just emit the signal if it did actually change. --- diff --git a/js/ui/keyboard.js b/js/ui/keyboard.js index 44660be54..be0146344 100644 --- a/js/ui/keyboard.js +++ b/js/ui/keyboard.js @@ -492,6 +492,7 @@ var FocusTracker = new Lang.Class({ _init() { this._currentWindow = null; + this._rect = null; global.display.connect('notify::focus-window', () => { this._setCurrentWindow(global.display.focus_window); @@ -535,6 +536,13 @@ var FocusTracker = new Lang.Class({ rect.y -= frameRect.y; } + if (this._rect && + this._rect.x == rect.x && + this._rect.y == rect.y && + this._rect.width == rect.width && + this._rect.height == rect.height) + return; + this._rect = rect; this.emit('position-changed'); },